package models

import (
	"gitee.com/dromara/carbon/v2"
)

// MemberLevel 会员等级
type MemberLevel struct {
	ID         int64         `json:"id" gorm:"id"`
	LevelName  string        `json:"level_name" gorm:"level_name"`
	LevelColor string        `json:"level_color" gorm:"level_color"`
	LevelDesc  string        `json:"level_desc" gorm:"level_desc"`
	Order      int64         `json:"order" gorm:"order"`
	State      int64         `json:"state" gorm:"state"`
	CreatedAt  carbon.Carbon `json:"created_at" gorm:"created_at"`
	UpdatedAt  carbon.Carbon `json:"updated_at" gorm:"updated_at"`

	Discount *MemberDiscount `json:"discount" gorm:"foreignKey:MemberLevel;references:ID"` // 会员折扣
}

// TableName 表名称
func (*MemberLevel) TableName() string {
	return "member_level"
}
